<ul>
	<?php
		$result = mysql_query('SELECT name, folder, photos_count FROM resorts', $conn);
		while ($row = mysql_fetch_array($result)) {
	?>
		<li>
			<div>
				<h1><?php echo $row['name']; ?></h1>
			</div>
			<div>
				<?php for ($i = 1; $i <= $row['photos_count']; $i++) {
					$image = 'images/places/'.$row['folder'].'/'.strtolower($row['folder']).'-'.strval($i).'.jpg';
				?>
					<a href="<?php echo $image; ?>" rel="lightbox[<?php echo $row['folder']; ?>]">
						<img src="<?php echo $image; ?>" alt="<?php echo $row['folder']; ?>" width="100" height="60" />
					</a>
				<?php } ?>
			</div>
		</li>
	<?php }	?>
</ul>